<!--
 * @Author: hq_deveolper hz858632@163.com
 * @Date: 2024-10-02 17:05:33
 * @LastEditors: hq_deveolper hz858632@163.com
 * @LastEditTime: 2024-10-03 18:22:06
 * @FilePath: \city-screen\src\views\JieXiangChuiShao\components\ChuiShaoShiXiangTongJi.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
    <div class="area">
        <div class="area-top">最新案件列表</div>
        <div class="area-main">
            <div @click="workOrderDetails($event)">
                <vue-seamless-scroll :class-option="classOption" :data="scrollData" class="warp" ref="mySwiper">
                    <ul>
                        <li :key="'a' + index" v-for="(item, index) in scrollData" class="card-new">
                            <div class="card-content">
                                <span :style="{ 'background': backColor(item.remark) }">{{ item.remark }}</span><span>{{
                                    item.whistleTitle }}</span>
                            </div>
                            <div class="card-info">
                                <div class="card-item">
                                    <div class="card-item-list">
                                        <div></div>
                                        <span>{{ '城管，执法队' }}</span>
                                    </div>
                                    <div class="card-item-list">
                                        <div></div>
                                        <span>{{ item.createTime }}</span>
                                    </div>
                                </div>
                                <div class="card-item">
                                    <div class="card-item-list">
                                        <div></div>
                                        <span>{{ '城管，执法队' }}</span>
                                    </div>
                                    <div class="card-item-list">
                                        <div></div>
                                        <span>{{ item.streetOrgName }}</span>
                                    </div>
                                </div>
                                <span class="btn">查看</span>
                            </div>
                        </li>
                    </ul>
                </vue-seamless-scroll>
            </div>
        </div>
    </div>
</template>
<script>
import { streetChuiShaoDB } from '@/api/index'
import vueSeamlessScroll from 'vue-seamless-scroll'
import Bus from '@/untils/bus'
import $ from 'jquery'
export default {
    components: {
        vueSeamlessScroll
    },
    props: {
        classOption: {
            type: Object,
            default: () => { }
        },
    },
    data() {
        return {
            newList: [],
            scrollData: [],
            colorList: [{ type: '日常事项', color: '#59D9FF' }, { type: '重要事项', color: '#FEBB3B' }, { type: '重大事项', color: '#FE3B72' }, { type: '其他事项', color: '#56DD9C' }]
        }
    },
    computed: {

    },
    mounted() {
        // this.getList({ undefined})
    },
    methods: {
        // 工单详情
        workOrderDetails(e) {
            let obj = $(e.target).data('item')
            const data = {
                id: obj.orderNum
            }
            Bus.$emit('openDetail', data)
        },
        getList({ streetId = undefined }) {
            streetChuiShaoDB.getNewStreetOrder({ streetId }).then(res => {
                this.scrollData = res.data
            })
        },
        backColor(text) {
            let color = ''
            this.colorList.forEach(item => {
                if (item.type == text) {
                    color = item.color
                }
            })
            return color
        }
    }
}
</script>

<style lang="less" scoped>
.area {
    width: 100%;
    padding: 0px 10px;

    .area-top {
        width: 460px;
        height: 41px;
        background: url(../../../assets/images/jiexiangchuishao/item-cillp.png) no-repeat;
        background-size: 100% 100%;
        margin-left: 50%;
        transform: translate(-50%);
        font-family: ShiShangZhongHeiJianTi;
        font-weight: 400;
        font-size: 18px;
        color: #FFFFFF;
        padding-left: 15px;
        line-height: 41px;
    }

    .area-main {
        width: 100%;
        height: 285px;
    }
}

.swiper-container {
    height: 400px;
}

.swiper-slide {
    height: 180px !important;
}

.chunk_con {
    // height: calc(100% - 40px);
    height: 100%;
}

.warp {
    overflow: hidden;
}

.latest_case {
    width: 100%;
    background: rgba(31, 73, 135, 0.25);
    margin-top: 20px;

    // border: 1px solid rgba(35, 104, 255, 0.25);
    .latest_case_title {
        width: 100%;
        height: 40px;
        background: rgba(31, 73, 135, 0.8);
        border: 1px solid rgba(35, 104, 255, 0.8);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 14px 0 18px;

        p:nth-child(1) {
            height: 20px;
            padding: 0 12px;
            background: #35cfe8;
            border-radius: 10px 10px 10px 0px;
            font-size: 12px;
            font-family: Source Han Sans CN;
            font-weight: 400;
            color: #ffffff;
            line-height: 20px;
        }

        p:nth-child(2) {
            font-size: 12px;
            font-family: Source Han Sans SC;
            font-weight: 400;
            color: #3cffff;
            line-height: 48px;
        }
    }

    .latest_case_text {
        width: 100%;
        padding: 16px 14px 13px 18px;
        max-height: 64px;
        overflow: hidden;
        font-size: 14px;
        font-family: Source Han Sans CN;
        font-weight: 400;
        color: #ffffff;
        line-height: 22px;
        word-wrap: break-word;
    }

    .latest_case_weizhi {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 14px 16px 18px;

        p:nth-child(1) {
            font-size: 12px;
            font-family: Source Han Sans CN;
            font-weight: 400;
            color: #9ed5ff;
        }

        p:nth-child(2) {
            height: 20px;
            background: rgba(31, 73, 135, 0.3);
            border: 1px solid #3cffff;
            border-radius: 10px;
            font-size: 12px;
            font-family: Source Han Sans CN;
            font-weight: 400;
            padding: 0 15px;
            z-index: 99;

            span {
                color: #ffffff;
                cursor: pointer;
            }
        }
    }
}

.card-new {
    background: url(../../../assets/images/jiexiangchuishao/new-card.png) no-repeat;
    background-size: 100% 100%;
    font-size: 14px;
    margin-bottom: 15px;
    width: 465px;
    height: 154px;
    padding: 20px;

    .card-content {
        // 文本多余两行后显示省略号
        overflow: hidden; // 溢出内容隐藏
        text-overflow: ellipsis; // 文本溢出部分用省略号表示
        display: -webkit-box; // 特别显示模式
        -webkit-line-clamp: 2; // 显示的行数 
        -webkit-box-orient: vertical; // 盒子中内容竖直排列
        color: rgba(60, 255, 255, 1);
        line-height: 25px;

        span {
            &:first-of-type {
                display: inline-block;
                margin-right: 5px;
                color: #fff;
                height: 25px;
                padding: 0px 15px;
                border-radius: 15px;
                background: #0093f3;

            }
        }
    }
}

.card-info {
    display: flex;
    // justify-content: space-between;
    align-items: flex-end;

    img {
        width: 56px;
        height: 56px;
    }

    .btn {
        padding: 2px 10px;
        margin-bottom: 5px;
        margin-right: 10px;
        margin-left: 30px;
        font-size: 12px;
        border: 1px solid rgba(0, 255, 255, 1);
        border-radius: 15px;
        color: #fff;
    }

    .card-item {
        &:first-of-type {
            margin-right: 5px;

            .card-item-list {
                display: flex;
                align-items: center;
                color: #fff;

                &:first-of-type {
                    div {
                        width: 35px;
                        height: 35px;
                        background: url(../../../assets/images/jiexiangchuishao/zerenren.png) no-repeat;
                        background-size: 60px 60px;
                        background-position: 50% 50%;
                    }

                }

                &:last-of-type {
                    div {
                        width: 35px;
                        height: 35px;
                        background: url(../../../assets/images/jiexiangchuishao/shijian.png) no-repeat;
                        background-size: 60px 60px;
                        background-position: 50% 50%;
                    }
                }

            }

        }

        &:last-of-type {
            .card-item-list {
                display: flex;
                align-items: center;
                color: #fff;

                &:first-of-type {
                    div {
                        width: 35px;
                        height: 35px;
                        background: url(../../../assets/images/jiexiangchuishao/chenggonganli.png) no-repeat;
                        background-size: 60px 60px;
                        background-position: 50% 50%;

                    }

                }

                &:last-of-type {
                    div {
                        width: 35px;
                        height: 35px;
                        background: url(../../../assets/images/jiexiangchuishao/weizhi.png) no-repeat;
                        background-size: 60px 60px;
                        background-position: 50% 50%;
                    }

                }

            }

        }
    }
}
</style>